home *** CD-ROM | disk | FTP | other *** search
/ ETO Development Tools 1 / ETO Development Tools 1.iso / Essentials / Developer Essentials Jul 90 / Programming / MPW Interfaces & Libraries 3.1 / PInterfaces / Graf3D.p < prev    next >
Encoding:
Text File  |  1989-10-13  |  2.3 KB  |  108 lines  |  [TEXT/MPS ]

  1. {
  2. Created: Friday, October 20, 1989 at 5:16 AM
  3.     Graf3D.p
  4.     Pascal Interface to the Macintosh Libraries
  5.  
  6.     Copyright Apple Computer, Inc.  1985-1989 
  7.     All rights reserved
  8. }
  9.  
  10.  
  11. {$IFC UNDEFINED UsingIncludes}
  12. {$SETC UsingIncludes := 0}
  13. {$ENDC}
  14.  
  15. {$IFC NOT UsingIncludes}
  16.     UNIT Graf3D;
  17.     INTERFACE
  18. {$ENDC}
  19.  
  20. {$IFC UNDEFINED UsingGraf3D}
  21. {$SETC UsingGraf3D := 1}
  22.  
  23. {$I+}
  24. {$SETC Graf3DIncludes := UsingIncludes}
  25. {$SETC UsingIncludes := 1}
  26. {$IFC UNDEFINED UsingQuickdraw}
  27. {$I $$Shell(PInterfaces)Quickdraw.p}
  28. {$ENDC}
  29. {$SETC UsingIncludes := Graf3DIncludes}
  30.  
  31. CONST
  32. radConst = 3754936;
  33.  
  34.  
  35. TYPE
  36.  
  37.  
  38. Point3D = RECORD
  39.     x: Fixed;
  40.     y: Fixed;
  41.     z: Fixed;
  42.     END;
  43.  
  44. Point2D = RECORD
  45.     x: Fixed;
  46.     y: Fixed;
  47.     END;
  48.  
  49. XfMatrix = ARRAY [0..3, 0..3] OF Fixed;
  50.  
  51. Port3DPtr = ^Port3D;
  52. Port3DHandle = ^Port3DPtr;
  53. Port3D = RECORD
  54.     grPort: GrafPtr;
  55.     viewRect: Rect;
  56.     xLeft: Fixed;
  57.     yTop: Fixed;
  58.     xRight: Fixed;
  59.     yBottom: Fixed;
  60.     pen: Point3D;
  61.     penPrime: Point3D;
  62.     eye: Point3D;
  63.     hSize: Fixed;
  64.     vSize: Fixed;
  65.     hCenter: Fixed;
  66.     vCenter: Fixed;
  67.     xCotan: Fixed;
  68.     yCotan: Fixed;
  69.     ident: BOOLEAN;
  70.     xForm: XfMatrix;
  71.     END;
  72.  
  73.  
  74.  
  75. PROCEDURE InitGrf3d(port: Port3DHandle);
  76. PROCEDURE Open3DPort(port: Port3DPtr);
  77. PROCEDURE SetPort3D(port: Port3DPtr);
  78. PROCEDURE GetPort3D(VAR port: Port3DPtr);
  79. PROCEDURE MoveTo2D(x: Fixed;y: Fixed);
  80. PROCEDURE MoveTo3D(x: Fixed;y: Fixed;z: Fixed);
  81. PROCEDURE LineTo2D(x: Fixed;y: Fixed);
  82. PROCEDURE Move2D(dx: Fixed;dy: Fixed);
  83. PROCEDURE Move3D(dx: Fixed;dy: Fixed;dz: Fixed);
  84. PROCEDURE Line2D(dx: Fixed;dy: Fixed);
  85. PROCEDURE Line3D(dx: Fixed;dy: Fixed;dz: Fixed);
  86. PROCEDURE ViewPort(r: Rect);
  87. PROCEDURE LookAt(left: Fixed;top: Fixed;right: Fixed;bottom: Fixed);
  88. PROCEDURE ViewAngle(angle: Fixed);
  89. PROCEDURE Identity;
  90. PROCEDURE Scale(xFactor: Fixed;yFactor: Fixed;zFactor: Fixed);
  91. PROCEDURE Translate(dx: Fixed;dy: Fixed;dz: Fixed);
  92. PROCEDURE Pitch(xAngle: Fixed);
  93. PROCEDURE Yaw(yAngle: Fixed);
  94. PROCEDURE Roll(zAngle: Fixed);
  95. PROCEDURE Skew(zAngle: Fixed);
  96. PROCEDURE Transform(src: Point3D;VAR dst: Point3D);
  97. FUNCTION Clip3D(src1: Point3D;src2: Point3D;VAR dst1: Point;VAR dst2: Point): INTEGER;
  98. PROCEDURE SetPt3D(VAR pt3D: Point3D;x: Fixed;y: Fixed;z: Fixed);
  99. PROCEDURE SetPt2D(VAR pt2D: Point2D;x: Fixed;y: Fixed);
  100. PROCEDURE LineTo3D(x: Fixed;y: Fixed;z: Fixed);
  101.  
  102. {$ENDC}    { UsingGraf3D }
  103.  
  104. {$IFC NOT UsingIncludes}
  105.     END.
  106. {$ENDC}
  107.  
  108.